package com.hzqy.persistence.dao.multirate;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.CmCatalogContentVo;
import com.hzqy.web.vo.CmCatalogVo;
import com.hzqy.web.vo.CmContentVo;
import com.hzqy.web.vo.CmMultirateContentVo;
import com.hzqy.web.vo.CmMultirateVo;
import com.hzqy.web.vo.CmPicturesVo;

@Repository
public class MultirateDao extends PersistenceDao<CmMultirateVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	
	public int findMultirateCount(CmMultirateVo cmMultirateVo) {
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "findMultirateCount", cmMultirateVo);
	}
	
	public List<CmMultirateVo> findMultirateList(Map<String,Object> map){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "findMultirateList", map);
	}
	
	public CmMultirateVo selectMultirate(int f_multirate_id) {
		return getSqlSession().selectOne(this.getNamespace() + "selectMultirate", f_multirate_id);
	}
	
	public CmMultirateVo selectMultirateByNumber(CmMultirateVo cmMultirateVo) {
		return getSqlSession().selectOne(this.getNamespace() + "selectMultirateByNumber", cmMultirateVo);
	}
	
	public int deleteMultirate(int f_multirate_id) {
		String namespace = this.getNamespace();
		return getSqlSession().delete(namespace + "deleteMultirate", f_multirate_id);
	}
	
	public int insertMultirate(CmMultirateVo cmMultirateVo) {
		return getSqlSession().insert(this.getNamespace() + "insertMultirate", cmMultirateVo);
	}
	
	public int updateMultirate(CmMultirateVo cmMultirateVo) {
		return getSqlSession().update(this.getNamespace() + "updateMultirate", cmMultirateVo);
	}
	
	public int findPackCount(Map<String,Object> map) {
		return getSqlSession().selectOne(this.getNamespace() + "findPackCount",map);
	}
	
	public List<CmContentVo> selectPackContent(Map<String,Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "selectPackContent", map);
	}
	
	public int findUnPackCount(Map<String,Object> map) {
		return getSqlSession().selectOne(this.getNamespace() + "findUnPackCount",map);
	}
	
	public List<CmContentVo> selectUnPackContent(Map<String,Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "selectUnPackContent", map);
	}
	
	public int insertPack(CmMultirateContentVo cmMultirateContentVo) {
		return getSqlSession().insert(this.getNamespace() + "insertPack", cmMultirateContentVo);
	}
	
	public int deletePack(CmMultirateContentVo cmMultirateContentVo) {
		return getSqlSession().delete(this.getNamespace() + "deletePack", cmMultirateContentVo);
	}
	
	public List<CmMultirateVo> selectBindMultirate(Map<String,Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "selectBindMultirate", map);
	}
	
	public List<CmMultirateVo> selectUnBindMultirate(Map<String,Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "selectUnBindMultirate", map);
	}
	
	public int findBindCount(Map<String,Object> map) {
		return getSqlSession().selectOne(this.getNamespace() + "findBindCount",map);
	}
	
	public int findUnBindCount(Map<String,Object> map) {
		return getSqlSession().selectOne(this.getNamespace() + "findUnBindCount",map);
	}
	
	public int insertBind(CmCatalogContentVo cmCatalogContentVo) {
		return getSqlSession().insert(this.getNamespace() + "insertBind", cmCatalogContentVo);
	}
	
	public int deleteBind(CmCatalogContentVo cmCatalogContentVo) {
		return getSqlSession().delete(this.getNamespace() + "deleteBind", cmCatalogContentVo);
	}
	
	public List<CmCatalogVo> selectContentBindCatalog(int f_cc_id) {
		return getSqlSession().selectList(this.getNamespace() + "selectContentBindCatalog", f_cc_id);
	}
	
	public List<CmCatalogVo> selectCatalogList() {
		return getSqlSession().selectList(this.getNamespace() + "selectCatalogList");
	}
	
	public List<CmCatalogContentVo> selectCatalogBind(int f_ccc_contentid) {
		return getSqlSession().selectList(this.getNamespace() + "selectCatalogBind",f_ccc_contentid);
	}
	
	public CmCatalogContentVo selectViewIndex(CmCatalogContentVo cmCatalogContentVo) {
		return getSqlSession().selectOne(this.getNamespace() + "selectViewIndex", cmCatalogContentVo);
	}
	
	public int updateViewIndex(CmCatalogContentVo cmCatalogContentVo) {
		return getSqlSession().update(this.getNamespace() + "updateViewIndex", cmCatalogContentVo);
	}

	public int updateStatus(CmMultirateVo cmMultirateVo) {
		return getSqlSession().update(this.getNamespace() + "updateStatus", cmMultirateVo);
	}
}
